package com.easylinkin.linkappapi.airconditioner.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easylinkin.linkappapi.airconditioner.entity.RegularTemperatureControlInfo;
import com.easylinkin.linkappapi.airconditioner.entity.ext.RefDeviceInfo;
import com.easylinkin.linkappapi.airconditioner.entity.ext.RegularTemperatureControlExt;
import com.easylinkin.linkappapi.device.entity.Device;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * class info :
 *
 * @author liuqihang
 * @date 2021/5/10 10:56
 */
public interface TimingTemperatureControlMapper extends BaseMapper<RegularTemperatureControlExt> {

    void addInfo(@Param("rtce") RegularTemperatureControlExt rtce);

    void addDetail(@Param("rtce") RegularTemperatureControlExt rtce);

    void updateInfo(RegularTemperatureControlExt rtce);

    void updateDetail(RegularTemperatureControlExt rtce);

//    void batchUpdateStatus(@Param("rtceList")List<RegularTemperatureControlExt> rtceList);
    void updateStatus(RegularTemperatureControlExt rtce);

    IPage<RegularTemperatureControlExt> getPage(Page page, @Param("rtce") RegularTemperatureControlExt rtce);

    RegularTemperatureControlExt getById(@Param("id") Long id);

    List<Device> getDeviceInfoById(@Param("id") Long id);

    List<RegularTemperatureControlInfo> validRepeat(@Param("rtci")RegularTemperatureControlInfo rtci);

    List<RegularTemperatureControlInfo> validRepeatExcludeSourceName(@Param("rtci")RegularTemperatureControlInfo rtci);

    void bindDevice(@Param("id")Long id, @Param("deviceList")List<Device> deviceList);

    void unbindDevice(@Param("id")Long id);

    List<RefDeviceInfo> getRefDeviceInfo(@Param("id")Long id);
}
